DEW.LoginController = function() {};

$.extend(DEW.LoginController.prototype, {
    render: function() {
        DEW.ViewManager.removeAll();
        this.displayLayout();
        this.displayHeader();
        this.displayBody();
        },

    displayLayout: function() {
        var baseLayout = new DEW.BaseLayout();
        baseLayout.render();
        $("#content").html(baseLayout.el);
        
        DEW.ViewManager.addView(baseLayout);
    },

    displayHeader: function() {
        var header = new DEW.Header();
        header.render();
        /* $(header.el).appendTo("#header"); */
        $("#header").html(header.el);
        
        
        var loginController = new DEW.LoginController();        
        $("#btnLogin").click(function(){
            DEW.ViewManager.remove(body);
            loginController.render();
            
            $(".page-content").html(loginController.el);
            DEW.ViewManager.addView(loginController);
        });
        
        
         var registerController = new DEW.RegisterController();        
        $("#btnResgistrate").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
            registerController.render();
            $(".page-content").html(registerController.el);
            DEW.ViewManager.addView(registerController);
        });
        
        var finderController = new DEW.FinderController();
        $("#btnTipoCocina").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
        finderController.render();       
        /* $(body.el).appendTo(".page-content"); */
      
         $("#content").html(finderController.el);
        DEW.ViewManager.addView(finderController);
        });
        DEW.ViewManager.addView(header);
    },
    

    displayBody: function() {
        
       
        
        var login = new DEW.Login();
        login.render();       
        /* $(body.el).appendTo(".page-content"); */
        $(".page-content").html(login.el);      
        DEW.ViewManager.addView(login);
        
    }


});/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


